package Controllers

import (
	"baikBingo/pkg/Util"
	"baikBingo/pkg/Wechat"

	"github.com/gin-gonic/gin"
)

type AuthController struct{}

func (vm *AuthController) Token(request *gin.Context) {

	jsCode := request.PostForm("jsCode")
	// userInfo := request.PostForm("userInfo")

	session := Wechat.Jscode2session(jsCode)

	Util.Response(request, gin.H{
		"code": Util.Config("response.success.code"),
		"msg":  Util.Config("response.success.msg"),
		"data": gin.H{
			"token": session,
		},
	})
}
